package com.test;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;

public class CalenderUtil {
	public static void main(String[] args) {
		Calendar calendar=Calendar.getInstance();
		DateFormat df=new SimpleDateFormat("yyyy-MM-dd");
		/*for(int i=1;i<=6;i++){
			String s=df.format(calendar.getTime());
			System.out.println(s);
		//calendar.set(Calendar.YEAR, -1);
			calendar.add(2, -1);
		}*/
		//calendar.add(2, -6);
		calendar.set(2, 3);
		calendar.set(2, -1);
		String s=df.format(calendar.getTime());
		System.out.println(s);
		String reg="[]()";
		System.out.println("reg="+reg.replaceAll("\\[\\]\\(\\)", ""));
		System.out.println("reg="+"(2013-05-13)".replaceAll("\\[\\]\\(\\)", ""));
	}
}
